/**
 * Created by Administrator on 2018/1/2.
 */
window.onload = function () {
    //获取li元素的集合
    var aLi = document.getElementsByTagName("li");
    //获取div元素的集合
    var aDiv = document.getElementsByTagName("div");
    for(var i=0;i<aLi.length;i++){
        aLi[i].index = i;
        aLi[i].onmouseover = function () {
            for(var i=0;i<aDiv.length;i++){
                aDiv[i].style.display = "none";
            }
            aDiv[this.index].style.display = "block";
        }

        aLi[i].onmouseout = function () {
            aDiv[this.index].style.display = "none";
        }
    }
};